(:: pragma bea:global-element-parameter parameter="$activateNewCustomer1" element="ns2:activateNewCustomer" location="../WSDLs/ImplWSMVNOInterface.wsdl" ::)
(:: pragma bea:global-element-return element="ns0:InventoryCheck" location="../WSDLs/InventoryCheck.wsdl" ::)

declare namespace ns2 = "http://ws.ejb.websrv.impl.css.amdocs.com";
declare namespace ns1 = "http://datatypes.util.ws.impl.css.amdocs.com";
declare namespace ns3 = "http://datatypes.sl.mvno.ws.impl.css.amdocs.com";
declare namespace ns0 = "http://www.example.org/InventoryCheck/";
declare namespace xf = "http://tempuri.org/ActivateNewCustomer/Transformation/activetNewCustomerInputToCheckInventory/";

declare function xf:activetNewCustomerInputToCheckInventory($activateNewCustomer1 as element(ns2:activateNewCustomer))
    as element(ns0:InventoryCheck) {
        <ns0:InventoryCheck>
            <partnerId>{ data(xs:decimal($activateNewCustomer1/ns2:activateNewCustomerInput/ns1:msoID)) }</partnerId>
            <macId>{ data($activateNewCustomer1/ns2:activateNewCustomerInput/ns3:customer/ns3:services[1]/ns3:device/ns3:macId) }</macId>
            {
                for $offerId in $activateNewCustomer1/ns2:activateNewCustomerInput/ns3:customer/ns3:services[1]/ns3:offerId
                return
                    <offerId>{ data($offerId) }</offerId>
            }
            {
                for $clearwireMarketId in $activateNewCustomer1/ns2:activateNewCustomerInput/ns3:customer/ns3:clearwireMarketId
                return
                    <clearwireMarketId>{ data($clearwireMarketId) }</clearwireMarketId>
            }
            {
                for $realm in $activateNewCustomer1/ns2:activateNewCustomerInput/ns3:customer/ns3:services[1]/ns3:device/ns3:realm
                return
                    <Realm>{ data($realm) }</Realm>
            }
            {
                for $mvnoMarketId in $activateNewCustomer1/ns2:activateNewCustomerInput/ns3:customer/ns3:services[1]/ns3:mvnoMarketId
                return
                    <mvnoMarketId>{ data($mvnoMarketId) }</mvnoMarketId>
            }
            {
                for $mvnoReferenceNumber in $activateNewCustomer1/ns2:activateNewCustomerInput/ns3:customer/ns3:mvnoReferenceNumber
                return
                    <mvnoReferenceNumber>{ data($mvnoReferenceNumber) }</mvnoReferenceNumber>
            }
            {
                for $lbsType in $activateNewCustomer1/ns2:activateNewCustomerInput/ns3:customer/ns3:services[1]/ns3:device/ns3:lbsType
                return
                    <lbsType>{ data($lbsType) }</lbsType>
            }
        </ns0:InventoryCheck>
};

declare variable $activateNewCustomer1 as element(ns2:activateNewCustomer) external;

xf:activetNewCustomerInputToCheckInventory($activateNewCustomer1)